<?php
/**
 * Created by PhpStorm.
 * User: ytl003
 * Date: 2018/10/1
 * Time: 下午7:13
 */

namespace app\api\model;


class SiteModel extends BaseModel
{
    protected $table = 'site';

    public function setTableDataAttr($value){
        return json_encode($value);
    }
    public function getTableDataAttr($value){
        return json_decode($value);
    }
    public function setTimeAttr($value){
        return json_encode($value);
    }
    public function getTimeAttr($value){
        return json_decode($value);
    }
    public function getImgUrlAttr($value){
        return config('setting.img_upload_prefix').$value;
    }
    public function getSwitchAttr($value){
        return $value?true:false;
    }
    public function setAnnexAttr($value){
        return json_encode($value);
    }
    public function getAnnexAttr($value){
        return json_decode($value);
    }
    public function getIsNeedAnnexAttr($value){
        return $value?true:false;
    }
}